1. Field of the Invention
The present invention relates to an error control apparatus used in a system for communicating data between a plurality of computers, and particularly to an apparatus for detecting and correcting errors in data transmitted.
2. Description of the Related Art
One example of data transmission error control will be described hereunder with reference to FIG. 1.
This figure shows a processing sequence of error control for data transmission from a transmitting computer referenced T to a receiving computer referenced R. This processing is carried out by CPUs (central processing units not shown) mounted in the respective computers.
(1) First, when data is transmitted from computer T, computer R receives and temporarily stores the data, and returns the data (the data returned being called echo data).
(2) Upon receipt of the echo data, computer T compares the data transmitted and echo data, and determines whether the two data are in agreement. In the event of disagreement, computer T decides that an error has occurred in the data transmission, outputs "NAK (negative acknowledge signal)" to computer R, and re-transmits the data thereto. Upon receipt of "NAK", computer R discards the data temporarily stored therein, and receives the data re-transmitted.
(3) If the data transmitted and echo data agree, computer T outputs "ACK (positive acknowledge signal)" to computer R. Then, computer R accepts the data temporarily stored therein.
The data transmitted as above is one of an "8-bit unit" divided from a group of data. This group of data is hereinafter referred to as a block data or just a block. Once data transmission for one block is completed, a block check (for detecting a transmission error for each block) is carried out as follows:
(4) The transmitting computer T performs Ex-OR operations (exclusive ORs) of all transmitted data in a block, and transmits results of the operations to computer R. Upon receipt of these results, computer R performs Ex-OR operations of the data received, and compares results of these operations with the results of the Ex-OR operations of the transmitted data to determine whether they agree or not. In the event of disagreement, computer R transmits an error signal to computer T. In the event of agreement, computer R transmits the results of the Ex-OR operations of the received data to computer T.
(5) Upon receipt of the error signal from computer R, computer T re-transmits the data in the block. If the results of the Ex-OR operations of the received data are received, computer T compares these results with the results of the Ex-OR operations of the transmitted data to determine whether they agree or not. In the event of disagreement, computer T re-transmits the data in the block. In the event of agreement, computer T transmits a completion command to computer R.
(6) Upon confirmation of receipt of the completion command, computer R transmits the same completion command back to computer T, and processes the data already received.
(7) After confirming the completion command returned from computer R, computer T proceeds to a next data transmission or other processing.
In this way, transmission errors are detected and corrected (by re-transmission) for individual data forming a block, and then a block check is carried out also. In the absence of transmission errors, the receiving computer R processes the data received. Besides the above system, there are various other transmission error controlling systems. Nevertheless, the sequence of "detecting and correcting transmission errors, and thereafter processing the data" is common to most of such systems.
However, although the data transmission error control described above is effective for dealing with errors occurring in data transmission per se, a certain problem arises in the following case.
A transmission error due to an external noise may occur in the final stage of data communication between the two computers R and T as set forth in paragraph (6) above, i.e. when the completion command is transmitted from computer R back to computer T in the above example. This will result in a discrepancy in decision between the receiving computer R and transmitting computer T. This discrepancy is such that the receiving computer R has confirmed completion of the data transmission, but the transmitting computer T has not.
Such a discrepancy between the two computers R and T affects subsequent processing. That is, the transmitting computer T, not having confirmed completion of the data transmission, re-transmits the same block data to the receiving computer R. Since the receiving computer R has confirmed completion of the preceding data transmission, this computer R regards this block data as new data and carries out processing accordingly. As a result, the processing sequence will be thrown into confusion.
Assume, for example, a sequence of carrying out certain processing after computer T transmits data B1 (i.e. data in a block) and then data B2 to computer R. When computer T fails to confirm completion of data B1 transmission and re-transmits data B1, computer R regards the re-transmitted data B1 as data B2 and carries out processing accordingly. As a result, the processing sequence of data B1 and then data B2 actually becomes a confused sequence of data B1 and again data B1.
A specific example of this problem will be described hereinafter in conjunction with "data transmission in a computer game machine". The computer game machine in this example provides a mechanized version of craps. In the game of craps, players place bets in desired positions on a craps table on which a layout is printed, two dice are thrown on the table, and the total number shown by the dice and the odds afforded by the positions in which the bets are placed determine wins and losses. The role to throw the dice (the thrower is called the shooter) is changed from one player to another in rotation.
As shown in perspective in FIG. 2, this game machine includes two CRT displays 1 disposed centrally thereof for displaying the same image as the layout of the craps table and dice presented by computer graphics, and six control panels 2 arranged around the CRT displays 1 to be operable individually by six players. The CRT displays 1 and control panels 2 constitute a game deck 3. The game machine further includes an illuminating table 4 supported on four columns over the game deck 3.
Each control panel 2 includes a trackball 5 for controlling the dice, a BET button 6 for betting coins, a payoff return, not shown, for paying out coins, a digital display for displaying the number of coins paid out, and a speaker for producing a sound effect.
The above craps game machine has a main CPU (M-CPU), and sub-CPUs (S-CPUs) provided for the respective control panels 2. The M-CPU controls displays on the CRT displays 1, progress of the game, the numbers of coins to be paid out, and the like. Each S-CPU extracts control data of the trackball 5, information on the number and position of coins bet by a player (BET information), and the like. And data communication is conducted between the M-CPU and S-CPUs.
The problem noted hereinbefore is expected to give rise to the following inconveniences, for example:
[1] Assume that the M-CPU outputs a command to the S-CPUs to transmit BET information whereupon the S-CPUs transmit the corresponding data to the M-CPU, and that an error occurs with a completion command finally transmitted from one S-CPU to the M-CPU. In this case, the M-CPU does not proceed to next processing, as it decides that the data transmission for BET information has not completed. This results in the inconvenience that the coins do not appear in the bet positions on the CRT displays 1 intended by the players.
[2] Assume that the M-CPU outputs a command to the S-CPUs to transmit control data of the trackballs 5 whereupon the S-CPUs transmit the corresponding data to the M-CPU, and that an error occurs with a completion command finally transmitted from one S-CPU to the M-CPU. In this case, the M-CPU does not proceed to next processing, as it decides that the control data transmission has not completed. This results in the inconvenience that the dice do not appear on the CRT displays 1 although a trackball 5 has been operated by a player.